package com.example.zbh.lessona.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import com.example.zbh.lessona.constant.Constant;

/**
 * Created by zbh on 15/12/4.
 */
public class SQHelper extends SQLiteOpenHelper {
    public SQHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql = "create table " + Constant.TABLE_NAME_PEOPLE + "(" + Constant.COLUMN_PEOPLE_AGE + " text," +
                Constant.COLUMN_PEOPLE_NAME + " text," + "_msgId integer primary key autoincrement" + ")";
        db.execSQL(sql);

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
